package com.example.fms.task;

import com.example.fms.FreightManagementSystemApplication;
import com.example.fms.service.ActivityService;
import com.example.fms.vo.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
@Component
public class runTask {

    @Resource
    private ConfigurableApplicationContext context;

    @Resource
    ActivityService activityService;

    @Scheduled(cron = "0 35 17 * * ?")
    public String upDateActivity() {
        System.out.println("活动状态变更开始");
        activityService.upDateActivityState();
        System.out.println("活动状态变更结束");
        return "success";
    }
}
